﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PlaylistEditorForCentrafuse.Playlist;

namespace PlaylistEditorForCentrafuse.GUI
{
    public partial class frmPlaylistDetails : Form
    {
        public PlaylistFile Playlist { get; set; }

        public frmPlaylistDetails()
        {
            InitializeComponent();
        }

        private void frmPlaylistDetails_Shown(object sender, EventArgs e)
        {
            if (Playlist != null)
            {
                txtFilename.Text = Playlist.Filename;
                lstMissingFiles.Items.Clear();
                lstDuplicates.Items.Clear();

                foreach (PlaylistEntry entry in Playlist.Entries)
                {
                    if (entry.IsMissing)
                    {
                        lstMissingFiles.Items.Add(entry.Filename);
                    }
                }

                foreach (PlaylistEntry entry in Playlist.Entries)
                {
                    if (entry.IsDuplicate)
                    {
                        lstDuplicates.Items.Add(entry.Filename);
                    }
                }
            }// if (currentProps != null)
        }
    }
}
